-- magic_crystal
-- created by xinj
-- 道具描述：魔能结晶

return {
    -- 获取道具描述
    getDesc = function(itemId, args, para)
        local petId   = args["pet_id"];
        local petName = PetM.query(petId, "name");
        local desc    = string.format(getLocStr("script_desc_macig_crystal"), petName);

        return desc;
    end,

    getDetail = function(itemId, args, para)
        local effect = "";
        local props = EquipM.query(itemId).prop;
        for i = 1, #props do
            if props[i][1] == 200 and i + 1 <= #props and
                props[i+1][1] == 200 then
                local desc = extractString(PropM.getPropDesc(props[i]));
                effect = effect .. string.format("[blue]%s[-]", desc) .. " ";
            else
                local desc = extractString(PropM.getPropDesc(props[i]));
                effect = effect .. string.format("[blue]%s[-]", desc) .. "\n";
            end
        end

        return effect;
    end,
};
